<% layout("/WEB-INF/view/console/skins/skin_2/layout.html", {}) {
%>
<div class="row">
    <div class="col-md-12">
        <div class="widget-container fluid-height clearfix">
            <div class="widget-content padded clearfix">
                 <div id="boProxyShippingAddressToolbar" class="btn-group">
                              <button type="button" class="btn btn-default" onclick="consoleOpenWindow('boProxyShippingAddress','${ctxPath}/console/bo_proxy_shipping_address/add','新增')">
                                  <i class="glyphicon glyphicon-plus"></i>
                              </button>
                              <button type="button" class="btn btn-default" onclick='boProxyShippingAddressConsoleGrid.delete("shippingAddressId","${ctxPath}/console/bo_proxy_shipping_address/delete");'>
                                  <i class="glyphicon glyphicon-trash"></i>
                              </button>
                 </div>
                     <div class='row'>
                              <div class='col-md-12'>
                                  <table id="boProxyShippingAddress" data-toggle="table"
                                         data-url="${ctxPath}/console/bo_proxy_shipping_address/json"
                                         data-pagination="true"
                                         data-query-params="boProxyShippingAddressLoadParam"
                                         method="post"
                                         data-side-pagination="server"
                                         data-show-refresh="true"
                                         data-show-toggle="true"
                                         data-pagination-loop="false"
                                         data-show-columns="true"
                                         data-toolbar="#boProxyShippingAddressToolbar">
                                      <thead>
                                      <tr>
                                           <th data-checkbox="true"></th>
                                            <th data-field='shippingAddressId' data-visible='false'>ID</th>
  <th data-sortable='true' data-field='prpxyId'>用户</th>
  <th data-sortable='true' data-field='consigneeName'>收件人</th>
  <th data-sortable='true' data-field='consigneePhone'>收件人电话</th>
  <th data-sortable='true' data-field='shippingPostcode'>邮编</th>
  <th data-sortable='true' data-field='shippingArea'>收货区域</th>
  <th data-sortable='true' data-field='shippingProvince'>省份</th>
  <th data-sortable='true' data-field='shippingCity'>城市</th>
  <th data-sortable='true' data-field='shippingCounty'>县/区</th>
  <th data-sortable='true' data-field='shippingDetailAddress'>详细地址</th>
  <th data-field='defaultAddress' data-sortable='true' data-formatter='boProxyShippingAddressdefault_addressFormatter'>是否是默认地址</th>
  <th data-field='shippingAddressId' data-formatter='boProxyShippingAddressTableOperate'>操作</th>
 
                                      </tr>
                                      </thead>
                                  </table>
                              </div>
                     </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
     var boProxyShippingAddressConsoleGrid =new consoleGrid({table_id:"boProxyShippingAddress"});
     boProxyShippingAddressConsoleGrid.init();
     function boProxyShippingAddressTableOperate(value){
         return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"boProxyShippingAddress\",\"${ctxPath}/console/bo_proxy_shipping_address/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
     }
    function boProxyShippingAddressLoadParam(params){
        params.query=boProxyShippingAddressQueryString();

        return params;
    }
     function boProxyShippingAddressQueryString() {
         var objQuery = new Object();
                objQuery.prpxyId=$('#prpxyId').val()==''?null:$('#prpxyId').val(); 
     objQuery.consigneeName=$('#consigneeName').val()==''?null:$('#consigneeName').val(); 
     objQuery.consigneePhone=$('#consigneePhone').val()==''?null:$('#consigneePhone').val(); 
     objQuery.shippingPostcode=$('#shippingPostcode').val()==''?null:$('#shippingPostcode').val(); 
     objQuery.shippingArea=$('#shippingArea').val()==''?null:$('#shippingArea').val(); 
     objQuery.shippingProvince=$('#shippingProvince').val()==''?null:$('#shippingProvince').val(); 
     objQuery.shippingCity=$('#shippingCity').val()==''?null:$('#shippingCity').val(); 
     objQuery.shippingCounty=$('#shippingCounty').val()==''?null:$('#shippingCounty').val(); 
     objQuery.shippingDetailAddress=$('#shippingDetailAddress').val()==''?null:$('#shippingDetailAddress').val(); 
     objQuery.defaultAddress=$('#defaultAddress').val()==''?null:$('#defaultAddress').val(); 
 
         var queryString = JSON.stringify(objQuery);
         return queryString;
     }

     function boProxyShippingAddressdefault_addressFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case '0': 
       showValue = '否';
       break;
       case '1': 
       showValue = '是';
       break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }

 </script>
<%} %>
 